#include <linux/types.h>
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <assert.h>
#include <string.h>
#include <unistd.h>

int main(int, char *[]);

int
main(int argc, char *argv[])
{

   assert(argc > 1);
   char buffer[100];
   char ix = 0;

   memset(buffer, '\0', 100);
   printf("input: %s\n", argv[1]);

   int fp = open("/dev/netdevice", O_RDWR);
   if (fp > 0)
      write(fp, argv[1], strlen(argv[1]));

   while(read(fp, &buffer[ix++], 1));

   printf("Reversed by the driver: %s\n", buffer);

   return 0;
}

